package com.coocaa.ops.admin.config;

import cloud.tianai.captcha.spring.store.CacheStore;

import cloud.tianai.captcha.spring.store.impl.LocalCacheStore;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

/**
 * @author tangminghong
 * @date 2020-06-12
 */
@Configuration
/**
 * 加载自定义Bean,xml文件的
 */
@ImportResource(locations = {"classpath*:biz-service-bean.xml"})
public class BizServiceBeanConfig {

    @Bean
    public CacheStore local() {
        return new LocalCacheStore();
    }

    @Bean(name = "multipartResolver")

    public CommonsMultipartResolver commonsMultipartResolver() {
        CommonsMultipartResolver commonsMultipartResolver = new CommonsMultipartResolver();
        commonsMultipartResolver.setDefaultEncoding("utf-8");
        commonsMultipartResolver.setMaxUploadSize(524288000);
        commonsMultipartResolver.setMaxInMemorySize(40960);
        return commonsMultipartResolver;
    }
}
